package com.qq.example.consumer;

import com.qq.example.common.model.User;
import com.qq.example.common.service.UserService;
import com.qq.rpc.RpcApplication;
import com.qq.rpc.proxy.ServiceProxyFactory;

/**
 * @author: zhengbin
 * @since: 2024/4/2  16:56
 * @version:1.0.0
 */
public class EasyExampleConsumer {
    public static void main(String[] args) {
        User user = new User();
        user.setName("qq");
        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User newUser = userService.getUser(user);
        if (newUser != null) {
            System.out.println(newUser.getName());
        } else {
            System.out.println("user==null");
        }
    }
}
